//
//  WaterfallFlowLayout.h
//  XMJJ_zml
//
//  Created by 杨何华 on 2025/5/8.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN
@protocol WaterfallFlowLayoutDelegate <NSObject>

// 用于获取每个 item 的高度
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout heightForItemAtIndexPath:(NSIndexPath *)indexPath;

@end
@interface WaterfallFlowLayout : UICollectionViewLayout
@property (nonatomic, weak) id<WaterfallFlowLayoutDelegate> delegate;

// 列数
@property (nonatomic, assign) NSInteger columnCount;

// 列间距
@property (nonatomic, assign) CGFloat columnSpacing;

// 行间距
@property (nonatomic, assign) CGFloat rowSpacing;

// 边缘间距
@property (nonatomic, assign) UIEdgeInsets sectionInset;
@end

NS_ASSUME_NONNULL_END
